<%@page import="com.ch7.model.BlogInfo"%>
<%@page import="com.ch7.common.DataConverter"%>
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>

<%@page import="com.ch7.model.UserInfo" %>
<%@page import="com.ch7.dal.Blog" %>
<%@page import="com.ch7.common.DataValidator" %>
<%@page import="com.ch7.common.Utility" %>
<%@page import="com.ch7.dal.Class" %>
<%@page import="com.ch7.model.ClassInfo" %>
<%@page import="com.ch7.model.CommentInfo" %>
<%@page import="com.ch7.dal.Comment" %>

<%
int id= DataConverter.toInt(request.getParameter("id"));
Blog blog=new Blog();
BlogInfo info =blog.getBlogInfo(id);
if(info==null){
out.println("<script>alert('博文ID有误')；window.location.href='index.jsp';</script>");
}
 %>



<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
  
    
    <title>博文详情</title>
    
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->

  </head>
  
  
  <body background="Image/timg.jpg" width=100% height=100%>
  <div class="header">
<style>
.header{ background:url(Image/2.jpg) no-repeat left top; height:618px;}}
</style>

</div>
    
    <div id="content">
    <div class="post">
    <h1 class="title"><%=info.getTitle() %></h1>
    <p class="byline"> <small><%=info.getCreatedtime() %></small></p>
    <div class="entry">
    <p> <%=DataValidator.serverhtmlDecode(info.getContext()) %></p>
    </div>
    <P class="meta"><a href="#" class="more">分类：<%=info.getClassName() %></a></P>
    </div>
     <a name="comment" id="comment"></a>
    <p class="meta">评论：</p><br>
    <%
    Comment comment=new Comment();
    List<CommentInfo> cmlist=comment.getListByBlogId(id);
    for(CommentInfo cminfo: cmlist){
    out.println(cminfo.getContext()+"<br>");
     out.println(cminfo.getCreatedtime()+"&nbsp;&nbsp;&nbsp;&nbsp;"+cminfo.getUsername()+"<br><hr>");
    }%>
    
     <jsp:include page="comment.jsp" >
     <jsp:param value="<%=id %>" name="id"/>
     </jsp:include>
     </div>
    
   
     
  </body>
</html>
